import { Component } from 'vue'

import MonitorPannel from '@/components/common/Earth/pannel/monitorpannel/index.vue'
import MeaturePannel from '@/components/common/Earth/pannel/meature/index.vue'
import PlotPannel from '@/components/common/Earth/pannel/plot/index.vue'
import ScenPannel from '@/components/common/Earth/pannel/scene/index.vue'
import LayerPannel from '@/components/common/Earth/pannel/layer/index.vue'
import SplitPannel from '@/components/common/Earth/pannel/splitpannel/index.vue'
import RollerPannel from '@/components/common/Earth/pannel/rollerpannel/index.vue'

import determinepannel from '@/components/common/Earth/pannel/determinepannel/index.vue'
import determineplotpannel from '@/components/common/Earth/pannel/determineplotpannel/index.vue'
import reportpannel from '@/components/common/Earth/pannel/reportpannel/index.vue'
import downLoad from '@/components/common/Earth/pannel/downLoad/index.vue'
import embeddingpannel from '@/components/common/Earth/pannel/embeddingpannel/index.vue'

import serviceFf from '@/components/common/Earth/pannel/serviceFf/index.vue'
import yxsearchpannel from '@/components/common/Earth/pannel/yxsearch/index.vue'
import aipannel from '@/components/common/Earth/pannel/aipannel/index.vue'
import linepannel from '@/components/common/Earth/pannel/linepannel/index.vue'

type PanelItem = {
    name: string
    component: Component
}

const pannelList: PanelItem[] = [
    {
        name: 'monitor-pannel',
        component: MonitorPannel,
    },
    {
        name: 'meature-pannel',
        component: MeaturePannel,
    },
    {
        name: 'plot-pannel',
        component: PlotPannel,
    },
    {
        name: 'determineplot-pannel',
        component: determineplotpannel,
    },
    {
        name: 'scene-pannel',
        component: ScenPannel,
    },
    {
        name: 'split-pannel',
        component: SplitPannel,
    },
    {
        name: 'roller-pannel',
        component: RollerPannel,
    },
    {
        name: 'layer-pannel',
        component: LayerPannel,
    },
    {
        name: 'determine-pannel',
        component: determinepannel,
    },
    {
      name: 'report-pannel',
      component: reportpannel,
  },
    {
        name: 'downLoad-pannel',
        component: downLoad,
    },
    {
        name: 'embedding-pannel',
        component: embeddingpannel,
    },
    {
        name: 'serviceFf-pannel',
        component: serviceFf,
    },
    {
        name: 'yxsearch-pannel',
        component: yxsearchpannel,
    },
    {
        name: 'ai-pannel',
        component: aipannel,
    },
    {
        name: 'line-pannel',
        component: linepannel,
    },
]

function findCompByName(name: string) {
    const comp = pannelList.find((item) => item.name === name)
    if (!comp) return console.warn(`name:${name} not exsit`)

    return comp?.component
}

export { pannelList, findCompByName }
